<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>我的订单列表</title>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" type="text/css" />
		<script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/js/bootstrap.min.js" type="text/javascript"></script>
		<!-- 引入自定义css文件 style.css -->
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css" />

		<style>
			body {
				margin-top: 20px;
				margin: 0 auto;
			}
			
			.carousel-inner .item img {
				width: 100%;
				height: 300px;
			}
			.z{
				color: #000;
			}
		</style>
	</head>

	<body>


<%@include file="/jsp/header.jsp" %>

		<div class="container">
			<div class="row">

				<div style="margin:0 auto; margin-top:10px;width:950px;">
					<strong>我的订单</strong>
					<table class="table table-bordered">
						<c:forEach items="${pb.list}" var="p">
						<tbody>
							<tr class="success">
								<th colspan="5">订单编号:${p.oid} 订单金额:${p.total} <%--订单总金额--%>
										<%--加入判断--%>
									<c:if test="${p.state==0}">
										<a href="${pageContext.request.contextPath}/order?methodName=getById&oid=${p.oid}">付款</a>
									</c:if>
									<c:if test="${p.state==1 }">
										已付款
									</c:if>
									<c:if test="${p.state==2 }">
										<a href="#">确认收货</a>
									</c:if>
									<c:if test="${p.state==3 }">
										已完成
									</c:if>

								</th>
							</tr>
							<tr class="warning">
								<th>图片</th>
								<th>商品</th>
								<th>价格</th>
								<th>数量</th>
								<th>小计</th>
							</tr>
							<c:forEach items="${p.items}" var="pl">
							<tr class="active">
								<td width="60" width="40%">
									<input type="hidden" name="id" value="22">
									<img src="${pageContext.request.contextPath}/${pl.product.pimage}" width="70" height="60">
								</td>
								<td width="30%">
									<a target="_blank">${pl.product.pname}</a>
								</td>
								<td width="20%">
									￥${pl.product.shop_price}
								</td>
								<td width="10%">
									${pl.count}
								</td>
								<td width="15%">
									<span class="subtotal">￥${pl.subtotal}</span>
								</td>
							</tr>
							</c:forEach>
						</tbody>
						</c:forEach>
					</table>
				</div>
			</div>
			<div style="text-align: center;">
				<ul class="pagination">

					<c:if test="${pb.currentPage==1}">
						<li class="disabled">
							<a href="javascript:void(0)" aria-label="Previous">
								<span aria-hidden="true">&laquo;</span>
							</a>
						</li>
					</c:if>
					<c:if test="${pb.currentPage!=1}">
						<li>
							<a href="${pageContext.request.contextPath}/order?methodName=getOrderlist&currentPage=${pb.currentPage-1}" aria-label="Previous">
								<span aria-hidden="true">&laquo;</span>
							</a>
						</li>
					</c:if>


					<c:forEach begin="1" end="${pb.totalPage}" var="p">
						<c:if test="${pb.currentPage==p}">
							<li class="active">
								<a href="javascript:void(0)">${p}</a>
							</li>
						</c:if>
						<c:if test="${pb.currentPage!=p}">
							<%--el表达式 内置对象：${param}:获取当前浏览器中地址栏的所有参数: Map<String ,String>--%>
							<li>
								<a href="${pageContext.request.contextPath}/order?methodName=getOrderlist&currentPage=${p}">${p}</a>
							</li>
						</c:if>
					</c:forEach>

					<c:if test="${pb.currentPage==pb.totalPage}">
						<li class="disabled">
							<a href="javascript:void(0)" aria-label="Previous">
								<span aria-hidden="true">&raquo;</span>
							</a>
						</li>
					</c:if>
					<c:if test="${pb.currentPage!=pb.totalPage}">
						<li>
							<a href="${pageContext.request.contextPath}/order?methodName=getOrderlist&currentPage=${pb.currentPage+1}" aria-label="Previous">
								<span aria-hidden="true">&raquo;</span>
							</a>
						</li>
					</c:if>


				</ul>
			</div>
		</div>

		<div style="margin-top:50px;">
			<img src="${pageContext.request.contextPath}/img/foot.jpg" width="100%" height="78" alt="我们的优势" title="我们的优势" />
		</div>

		<div style="text-align: center;margin-top: 5px;">
			<ul class="list-inline">
				<li><a class="z">关于我们</a></li>
				<li><a class="z">联系我们</a></li>
				<li><a class="z">招贤纳士</a></li>
				<li><a class="z">法律声明</a></li>
				<li><a class="z">友情链接</a></li>
				<li><a target="_blank" class="z">支付方式</a></li>
				<li><a target="_blank" class="z">配送方式</a></li>
				<li><a class="z">服务声明</a></li>
				<li><a class="z">广告声明</a></li>
			</ul>
		</div>
		<div style="text-align: center;margin-top: 5px;margin-bottom:20px;color: black">
			Copyright &copy;2020-2030  Rice mall
		</div>
	</body>

</html>